The invention relates to the transmission of quantized data through a communications channel, and in particular, to the transmission of block encoded video or image data through a bandwidth limited communications channel.
Most image and video compression systems, at some point, must decide how to allocate available transmitter bits to the image or frame of video to be compressed. A variety of methods have been developed by those working in this field to predict how many bits are needed to achieve some average distortion over the frame. Unfortunately, these methods assume a model for the statistics of the data to be compressed which seldom accurately represents the true underlying statistics, and the actual bits generated will generally differ from the number predicted. If the actual number of bits is less than the predicted number of bits, some bandwidth of the communications channel is likely to be wasted. On the other hand, if the actual number of bits is greater than the predicted number of bits there may result either buffer overflow and a resulting loss of information and increased distortion of the reconstructed image, or frame skipping while these extra bits are transmitted from transmitter to receiver. If a precise number of bits is required, one can iteratively converge to the "optimal" allocation by repeatedly encoding the image and adjusting the bit allocation. This is not suitable, however, for real time systems, which often have time to encode each image frame only once.
In accordance with a recently adopted standard (CCITT H.261) for encoding image data representative of a sequence of two-dimensional arrays of image data, the two-dimensional array is divided into a plurality of blocks, each block being an 8.times.8 sub-array of image representing data. Each block of data is encoded in accordance with the standard and is transmitted to a remote receiver which reconstructs the encoded blocks and thus reconstructs the entire image. The CCITT H.261 standard provides for 31 different quantizer step sizes for use in the encoding process. During the encoding process, varying the quantizer step size will dramatically change, over the full range of available step sizes, the number of bits needed to code a sequence of blocks. In accordance with the standard, the encoder sends a quantizer step size to the receiver for each so-called "Group of Blocks" (GOP). The encoder can also change the quantizer at the "macroblock" (MB) level using a so-called MTYPE signaling of a new quantizer step size followed by 5 bits of quantizer information. Thus, if one were able to accurately predict the needed step size, the number of bits used to describe a complete image can be reasonably controlled.
Accordingly, it is an object of the invention to provide a method and apparatus for accurately optimizing the number of bits transmitted for an image to achieve a selected target number of bits when the image is complete. Other objects of the invention are methods and apparatus for selecting an initial quantizer step size, and accurately and precisely controlling step size so that the number of bits allocated to the image does not provide either an overflow condition or an underflow condition.